import React,{Component} from 'react'
import {Link} from 'react-router-dom'
import {getParameter} from '../static/js/common.js'
class Child2 extends Component{
  constructor(){
    super();
    this.state = {
      myName : "这里是child2页面"
    }
  }
  componentWillMount(){

  }
  showName(){
console.log(this.props.match.params.id);
  console.log(getParameter('id'));
  }
  goIndox(){
    this.props.history.push({
      pathname:"/inbox",
      query:{
        name:"inbox",
        myas:"哈哈"
      }
    })
  }
  render(){
    return (
      <div>
        {this.state.myName}
        <div>
          <h1>child2页面</h1>
          <button onClick={this.showName.bind(this)}>按钮</button>
          <div>
            <button onClick={this.goIndox.bind(this)}>inbox</button>
          </div>
        </div>
      </div>
    )
  }
}
export default Child2
